package com.bjpowernode.springboot;

import com.bjpowernode.springboot.service.StudentService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        //获取Spring容器
        ConfigurableApplicationContext applicationContext = SpringApplication.run(Application.class, args);
        //从spring容器中获取到实体bean
        StudentService studentServiceImpl = (StudentService) applicationContext.getBean("studentServiceImpl");
        String say = studentServiceImpl.sayHello();
        System.out.println(say);
    }

}
